<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<jsp:include page="/WEB-INF/jsp/common/_scripts.jsp" />
<%@ include file="/WEB-INF/jsp/common/_includes.jsp" %>

<!DOCTYPE html>
<html>
<head>
<title>子栏目列表</title>
</head>
<body>
<div id="container" class="thirteen wide column">
	 <ol class="breadcrumb">
		<li></li>
	 </ol>
	 <ul class="nav nav-pills" role="tablist">
	                   <li role="presentation" class="active">
	                   	<a href="javascript:void(0)" onclick="document.forms[0].submit()">录入子栏目</a>
	      	<form method="get" action="/channel/add">
	      		<input type="hidden" id="level" name="level" value=""/>
	      	</form>
	      </li>
	  </ul>
	  <table class="table table-hover">
	      <thead>
	      <tr>
	          <th>栏目ID</th>
	          <th>栏目编号</th>
	          <th>栏目标题</th>
	          <th>父栏目编号</th>
	          <th>排序号</th>
	          <th>是否有内容</th>
	          <th>是否显示</th>
	          <th>操作</th>
	      </tr>
	      </thead>
	      <tbody>
	      <c:forEach items="${channelList }" var="channel">
	          <tr>
	              <td>${channel.id}</td>
	              <td>${channel.code }</td>
	              <td>${channel.name}</td>
	              <td>${channel.level }</td>
	              <td>${channel.priority }</td>
	              <td>
	              	
	              	<c:choose>
	              		<c:when test="${channel.hasContent==0 }">
	              			否
	              		</c:when>
	              		<c:when test="${channel.hasContent==1 }">
	              			是
	              		</c:when>
	              	</c:choose>
	              </td>
	              <td>
	              	<c:choose>
	              		<c:when test="${channel.isDisplay==0 }">
	              			否
	              		</c:when>
	              		<c:when test="${channel.isDisplay==1 }">
	              			是
	              		</c:when>
	              	</c:choose>
	              </td>
	              <td>
	                  <a class="btn active btn-primary btn-sm"  href="/channel/${channel.id}/edit">编辑</a>
	         		</td>
	          </tr>
	      </c:forEach>
	      </tbody>
	  </table>
	  
	  <div class="page-info clearfix">
	       <jsp:include page="/WEB-INF/jsp/common/_page.jsp"/>
	  </div>
</div>
<script type="text/javascript" src="/static/js/channel/list_child.js"></script>
<script type="text/javascript">
	$(function(){
		var nodeId = window.parent.nodeId;
		var nodeName = window.parent.nodeName;
		$("ol.breadcrumb>li").text("当前目录："+nodeName);
		$("#level").val(nodeId);
		
	});
</script>
</body>
</html>